﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Xml;
using System.Xml.Linq;

namespace EAISimulatedWebService
{
    /// <summary>
    /// Summary description for ESBWebEntry
    /// </summary>
    [WebService(Namespace = "http://eai.metlife.com")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class ESBWebEntry : System.Web.Services.WebService
    {

        [WebMethod]
        [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://eai.metlife.com/ESBWebEntry/ProcessMessage", OneWay = false, Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Default)]
        public ESBEnvelopeResult ProcessMessage(ESBEnvelope ESBEnvelope)
        {
            XmlDocument doc = new XmlDocument();
            doc.LoadXml("<XML xmlns=\"http://MetLifeEAI.EAISchema\"><AURATX><Policy><OwnerInfo><OWNERSEL></OWNERSEL><LSURNAME></LSURNAME><OwnerTelFlg>NaN</OwnerTelFlg><OwnerMobilePHFlg></OwnerMobilePHFlg><OwnerMoneyLundry></OwnerMoneyLundry><OwnerPolicyHistory><OwnerPolicy><ProposalNum>99999999999H</ProposalNum><Chdrnum></Chdrnum><CHDRTYPE></CHDRTYPE><PolicyStatus></PolicyStatus><CNTBRANCH></CNTBRANCH><AGNTSEL></AGNTSEL><MOPInit></MOPInit><MOPSeq></MOPSeq><BILLFREQ></BILLFREQ><HPROPDTE></HPROPDTE><IssueDate></IssueDate><EffectiveDate></EffectiveDate><Insured><Life></Life><CoverageRiders><CoverageList><Coverage></Coverage><RIDER></RIDER><CRTABLE>HOLDERCOV01</CRTABLE><INSTPRM>.00</INSTPRM><LMPCNT>.00</LMPCNT><RegularPrem></RegularPrem><SUMIN>0</SUMIN><RCESSTRM></RCESSTRM><RCESSAGE></RCESSAGE><PCESSTRM></PCESSTRM><PCESSAGE></PCESSAGE><RiskAmntList></RiskAmntList><CovrField1></CovrField1></CoverageList></CoverageRiders></Insured><LifeInsured><LIFCNUM></LIFCNUM><LSURNAME></LSURNAME><RelationShip></RelationShip><HealthInfos><Question><QUESTIDF></QUESTIDF><QUESTDES></QUESTDES><ANSWER></ANSWER></Question></HealthInfos></LifeInsured><BeneficiaryList><Beneficiary><BNYSEL></BNYSEL><LSURNAME></LSURNAME><CLTRELN></CLTRELN><BNYPC></BNYPC></Beneficiary></BeneficiaryList><ClaimFlag></ClaimFlag><SpecialTermFlag></SpecialTermFlag><WithdrawFlag></WithdrawFlag><DeclineFlag></DeclineFlag><PostponeFlag></PostponeFlag><CounteroffFlag></CounteroffFlag><SubStandardFlag></SubStandardFlag><HealthInfoFlag></HealthInfoFlag><OwnerPolField1></OwnerPolField1></OwnerPolicy></OwnerPolicyHistory><OwnerBlackList><OwnerRelList>N</OwnerRelList><OwnerPolitics>N</OwnerPolitics><OwnerTerroList>N</OwnerTerroList><OwnerGreyList>N</OwnerGreyList></OwnerBlackList></OwnerInfo><Insureds><Insured><LIFCNUM></LIFCNUM><LSURNAME></LSURNAME><InsuredTelFlg></InsuredTelFlg><InsuredMobilePHFlg></InsuredMobilePHFlg><InsuredMoneyLundry></InsuredMoneyLundry><InsuredPolicyHistory><InsuredPolicy><ProposalNum>99999999999I</ProposalNum><Chdrnum></Chdrnum><CHDRTYPE></CHDRTYPE><PolicyStatus></PolicyStatus><CNTBRANCH></CNTBRANCH><AGNTSEL></AGNTSEL><MOPInit></MOPInit><MOPSeq></MOPSeq><BILLFREQ></BILLFREQ><HPROPDTE></HPROPDTE><IssueDate></IssueDate><EffectiveDate></EffectiveDate><LifeIns><Life></Life><CoverageRiders><CoverageList><Coverage></Coverage><RIDER></RIDER><CRTABLE>INSUREDCOV01</CRTABLE><INSTPRM>.00</INSTPRM><LMPCNT>.00</LMPCNT><RegularPrem></RegularPrem><SUMIN>0</SUMIN><RCESSTRM></RCESSTRM><RCESSAGE></RCESSAGE><PCESSTRM></PCESSTRM><PCESSAGE></PCESSAGE><RiskAmntList></RiskAmntList><CovrField1></CovrField1></CoverageList></CoverageRiders></LifeIns><LifeInsured><LIFCNUM></LIFCNUM><LSURNAME></LSURNAME><RelationShip></RelationShip><HealthInfos><Question><QUESTIDF></QUESTIDF><QUESTDES></QUESTDES><ANSWER></ANSWER></Question><Summary></Summary></HealthInfos></LifeInsured><BeneficiaryList><Beneficiary><BNYSEL></BNYSEL><LSURNAME></LSURNAME><CLTRELN></CLTRELN><BNYPC></BNYPC></Beneficiary></BeneficiaryList><ClaimFlag></ClaimFlag><SpecialTermFlag></SpecialTermFlag><WithdrawFlag></WithdrawFlag><DeclineFlag></DeclineFlag><PostponeFlag></PostponeFlag><SubStandardFlag></SubStandardFlag><CounteroffFlag></CounteroffFlag><HealthInfoFlag></HealthInfoFlag><POSUWFlag></POSUWFlag><ClaimUWFlag></ClaimUWFlag><InsuredPolField1></InsuredPolField1></InsuredPolicy></InsuredPolicyHistory><InsuredBlackList><InsuredRelList>N</InsuredRelList><InsuredPolitics>N</InsuredPolitics><InsuredTerroList>N</InsuredTerroList><InsuredGreyList>N</InsuredGreyList></InsuredBlackList></Insured></Insureds><BeneficiaryList><BeneBlackList><BeneRelList>N</BeneRelList><BenePolitics>N</BenePolitics><BeneTerroList>N</BeneTerroList><BeneGreyList>N</BeneGreyList></BeneBlackList></BeneficiaryList><AgentInfo><AGNTSEL></AGNTSEL><AgentSaleFlg></AgentSaleFlg><AgentcorrectFlg></AgentcorrectFlg><AgentorgFlg></AgentorgFlg><AgentTelFlg></AgentTelFlg><BankOptvalidFlg></BankOptvalidFlg><BankOptSaleFlg></BankOptSaleFlg><AgentvalidFlg></AgentvalidFlg><CITIFLG></CITIFLG><EliteAgent></EliteAgent></AgentInfo><CurrentPolicy><OutstandingUW></OutstandingUW><Insured><Life></Life><CoverageList></CoverageList></Insured></CurrentPolicy><PolcyField1></PolcyField1><PolcyField2></PolcyField2><PolcyField3></PolcyField3><PolcyField4></PolcyField4><PolcyField5></PolcyField5></Policy><ReturnCode>BOMB</ReturnCode><ReturnDesc>错误不在文件中</ReturnDesc></AURATX></XML>");

            var ESBEnvelopeResult = new ESBEnvelopeResult();
            ESBEnvelopeResult.ESBHeader = new ESBEnvelopeResultESBHeader();
            ESBEnvelopeResult.ESBHeader.SenderID = "SimlatedLA";
            ESBEnvelopeResult.ESBHeader.ReceiverID = "AURA";
            ESBEnvelopeResult.ESBHeader.SrvOpName = "inquiryInsPolHistservice";
            ESBEnvelopeResult.ESBHeader.ESBRspCode = "0";
            ESBEnvelopeResult.ESBHeader.ESBHdVer = "20120608_1.1";
            ESBEnvelopeResult.ESBHeader.SrvOpVer = "20120606_1.1";
            ESBEnvelopeResult.ESBHeader.MsgID = "c274b1cf-c06c-4de3-90de-11546a0ee619";
            ESBEnvelopeResult.ESBHeader.CorrID = "4b31d5dc-74b1-4aaa-a242-141cadc5db14";

            ESBEnvelopeResult.MsgBody = doc.DocumentElement;

            return ESBEnvelopeResult;
        }
    }

    /// <remarks/>
    // http://MetLifeEAI.EAISchema#ESBEnvelope --> ESBEnvelope
    [System.CodeDom.Compiler.GeneratedCodeAttribute("BTSWebSvcWiz", "3.9.469.0")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MetLifeEAI.EAISchema")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://MetLifeEAI.EAISchema", IsNullable = false)]
    public partial class ESBEnvelope
    {

        private ESBEnvelopeESBHeader eSBHeaderField;

        private System.Xml.XmlElement msgBodyField;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public ESBEnvelopeESBHeader ESBHeader
        {
            get
            {
                return this.eSBHeaderField;
            }
            set
            {
                this.eSBHeaderField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public System.Xml.XmlElement MsgBody
        {
            get
            {
                return this.msgBodyField;
            }
            set
            {
                this.msgBodyField = value;
            }
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("BTSWebSvcWiz", "3.9.469.0")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MetLifeEAI.EAISchema")]
    public partial class ESBEnvelopeESBHeader
    {

        private string eSBHdVerField;

        private System.DateTime srvDateField;

        private System.DateTime srvTimeField;

        private string senderIDField;

        private string receiverIDField;

        private string srvOpNameField;

        private string srvOpVerField;

        private string msgIDField;

        private string corrIDField;

        private string eSBRspCodeField;

        private string eSBRspDecField;

        private string resField1Field;

        private string resField2Field;

        private string resField3Field;

        private string resField4Field;

        private string resField5Field;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ESBHdVer
        {
            get
            {
                return this.eSBHdVerField;
            }
            set
            {
                this.eSBHdVerField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, DataType = "date")]
        public System.DateTime SrvDate
        {
            get
            {
                return this.srvDateField;
            }
            set
            {
                this.srvDateField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, DataType = "time")]
        public System.DateTime SrvTime
        {
            get
            {
                return this.srvTimeField;
            }
            set
            {
                this.srvTimeField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string SenderID
        {
            get
            {
                return this.senderIDField;
            }
            set
            {
                this.senderIDField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ReceiverID
        {
            get
            {
                return this.receiverIDField;
            }
            set
            {
                this.receiverIDField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string SrvOpName
        {
            get
            {
                return this.srvOpNameField;
            }
            set
            {
                this.srvOpNameField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string SrvOpVer
        {
            get
            {
                return this.srvOpVerField;
            }
            set
            {
                this.srvOpVerField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string MsgID
        {
            get
            {
                return this.msgIDField;
            }
            set
            {
                this.msgIDField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CorrID
        {
            get
            {
                return this.corrIDField;
            }
            set
            {
                this.corrIDField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ESBRspCode
        {
            get
            {
                return this.eSBRspCodeField;
            }
            set
            {
                this.eSBRspCodeField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ESBRspDec
        {
            get
            {
                return this.eSBRspDecField;
            }
            set
            {
                this.eSBRspDecField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField1
        {
            get
            {
                return this.resField1Field;
            }
            set
            {
                this.resField1Field = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField2
        {
            get
            {
                return this.resField2Field;
            }
            set
            {
                this.resField2Field = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField3
        {
            get
            {
                return this.resField3Field;
            }
            set
            {
                this.resField3Field = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField4
        {
            get
            {
                return this.resField4Field;
            }
            set
            {
                this.resField4Field = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField5
        {
            get
            {
                return this.resField5Field;
            }
            set
            {
                this.resField5Field = value;
            }
        }
    }

    /// <remarks/>
    // http://MetLifeEAI.EAISchema#ESBEnvelopeResult --> ESBEnvelopeResult
    [System.CodeDom.Compiler.GeneratedCodeAttribute("BTSWebSvcWiz", "3.9.469.0")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MetLifeEAI.EAISchema")]
    [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://MetLifeEAI.EAISchema", IsNullable = false, ElementName = "ESBEnvelopeResult")]

    public partial class ESBEnvelopeResult
    {

        private ESBEnvelopeResultESBHeader eSBHeaderField;

        private System.Xml.XmlElement msgBodyField;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public ESBEnvelopeResultESBHeader ESBHeader
        {
            get
            {
                return this.eSBHeaderField;
            }
            set
            {
                this.eSBHeaderField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public System.Xml.XmlElement MsgBody
        {
            get
            {
                return this.msgBodyField;
            }
            set
            {
                this.msgBodyField = value;
            }
        }
    }

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("BTSWebSvcWiz", "3.9.469.0")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://MetLifeEAI.EAISchema")]
    public partial class ESBEnvelopeResultESBHeader
    {

        private string eSBHdVerField;

        private System.DateTime srvDateField;

        private System.DateTime srvTimeField;

        private string senderIDField;

        private string receiverIDField;

        private string srvOpNameField;

        private string srvOpVerField;

        private string msgIDField;

        private string corrIDField;

        private string eSBRspCodeField;

        private string eSBRspDecField;

        private string resField1Field;

        private string resField2Field;

        private string resField3Field;

        private string resField4Field;

        private string resField5Field;

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ESBHdVer
        {
            get
            {
                return this.eSBHdVerField;
            }
            set
            {
                this.eSBHdVerField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, DataType = "date")]
        public System.DateTime SrvDate
        {
            get
            {
                return this.srvDateField;
            }
            set
            {
                this.srvDateField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, DataType = "time")]
        public System.DateTime SrvTime
        {
            get
            {
                return this.srvTimeField;
            }
            set
            {
                this.srvTimeField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string SenderID
        {
            get
            {
                return this.senderIDField;
            }
            set
            {
                this.senderIDField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ReceiverID
        {
            get
            {
                return this.receiverIDField;
            }
            set
            {
                this.receiverIDField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string SrvOpName
        {
            get
            {
                return this.srvOpNameField;
            }
            set
            {
                this.srvOpNameField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string SrvOpVer
        {
            get
            {
                return this.srvOpVerField;
            }
            set
            {
                this.srvOpVerField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string MsgID
        {
            get
            {
                return this.msgIDField;
            }
            set
            {
                this.msgIDField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string CorrID
        {
            get
            {
                return this.corrIDField;
            }
            set
            {
                this.corrIDField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ESBRspCode
        {
            get
            {
                return this.eSBRspCodeField;
            }
            set
            {
                this.eSBRspCodeField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ESBRspDec
        {
            get
            {
                return this.eSBRspDecField;
            }
            set
            {
                this.eSBRspDecField = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField1
        {
            get
            {
                return this.resField1Field;
            }
            set
            {
                this.resField1Field = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField2
        {
            get
            {
                return this.resField2Field;
            }
            set
            {
                this.resField2Field = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField3
        {
            get
            {
                return this.resField3Field;
            }
            set
            {
                this.resField3Field = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField4
        {
            get
            {
                return this.resField4Field;
            }
            set
            {
                this.resField4Field = value;
            }
        }

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
        public string ResField5
        {
            get
            {
                return this.resField5Field;
            }
            set
            {
                this.resField5Field = value;
            }
        }
    }

}
